package com.morgan.storageperlib.saf

import android.content.Intent
import android.graphics.Bitmap
import android.net.Uri
import androidx.activity.result.ActivityResult
import androidx.activity.result.contract.ActivityResultContract
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import com.morgan.storageperlib.utils.Utils
import java.io.OutputStream

/**
 *description：写入Bitmap
 *<br>author：caowugao
 *<br>time：2021/3/8 0008 16:37
 */
class WriteBitmapHandler(relativeDir : String? = null, imeiType : String = "image/png", fileName : String, content : Bitmap, act : AppCompatActivity, contract : ActivityResultContract<Intent, ActivityResult> = ActivityResultContracts.StartActivityForResult(), callback : ((Boolean, Uri?, OutputStream?) -> Unit)? = null) : WriteFileHandler(relativeDir, imeiType, fileName, Utils.bitmap2ByteArray(content) ?: ByteArray(0), false, act, contract, callback) {
}